<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
    <th:block th:include="include :: header('主轴监控列表')" />
    <th:block th:include="include :: footer" />
</head>


    <style>
        .bg{
            width: 100%;
            height: 100%;
            background-image: url(/admin/images/beiJing.jpg);
            background-repeat: no-repeat;
            background-size: 100% 100%;
        }
        html {
            height: 100%;
            display: table;
        }

        body {
            display: table-cell;
            height: 100%;
        }

        /*主轴div主体模块*/
        .axisDivAll{
            width: 1700px;
            height: 545px;
        }
        /*翻页div*/
        .axisPageDiv{
            width: 985px;
            text-align: right;
        }

        /*主轴css样式*/
        .axisDiv{
            text-align: left;
            font-size: 7px;
            width: 300px;
            height: 220px;
            /*background-color: #00FF00;*/
            padding: 5px;
            float: left;
            margin: 2px 2px 2px 2px;
        }

        /*模态框展示图片css*/
        .modalEcharts{
            width: 150px;
            height: 150px;
            padding: 2px;
            float: left;
        }


        /*模态框主轴属性空间css*/
        .modalAxisDiv{
            height: 120px;
            width: 500px;
            float: left;
        }
        /*模态框主轴单个属性css*/
        .modalAxisDivChirean{
            height: 40px;
            width: 160px;
            padding: 2px;
            float: left;
            text-align: left;
        }

    </style>

<script src="/component/echarts/echarts.min.js"></script>

<body class="pear-container">
<div class="bg">
    <div class="layui-card">
        <div class="layui-card-body">
            <div class="col-sm-12 search-collapse">
                <form id="formId" method="get">
                    <label >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位置：</label>
                    <select name="axisSpace" style="width: 130px" >
                        <option value="">不限</option>
                        <option value="机房1">机房1</option>
                        <option value="机房2">机房2</option>
                        <option value="机房3">机房3</option>
                    </select>
                    <label >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;型号：</label>
                    <select name="axisType"  style="width: 130px"  >
                        <option value="">所有</option>
                        <option value="型号1">型号1</option>
                        <option value="型号2">型号2</option>
                        <option value="型号3">型号3</option>
                        <option value="型号4">型号4</option>
                    </select>
                    <label >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;状态：</label>
                    <select name="axisState" id="axisState" style="width: 130px" >
                        <option value="正常">正常</option>
                        <option value="调试">调试</option>
                        <option value="故障">故障</option>
                    </select>
                    <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                    <button type="button" id="axisQuery" class="pear-btn pear-btn-md pear-btn-primary"  style="width: 75px" />查询</button>
                    <button type="reset" class="pear-btn pear-btn-md">
                        <i class="layui-icon layui-icon-refresh"></i>
                        重置
                    </button>
                </form>
            </div>
        </div>
    </div>
    <form id="pageForm" method="get">
        <input id="limit" name="limit" type="text" style="display: none" value="12">
        <input id="page" name="page" type="text" style="display: none" value="0">
    </form>
    <!--分页条数-->
    <input id="axisCount" value="" style="display: none">

    <!--主轴div展示模块-->
    <div id="axisDivAll" class="axisDivAll"></div>
    <div class="axisPageDiv">
        <div id="switch" class="pear-btn pear-btn-md pear-btn-primary"  onclick="showdiv()">显示表单</div>
        <input type="button" id="axisPrev" class="pear-btn pear-btn-md pear-btn-primary" value="上一页" style="width: 75px;" />
        <input type="text" id="pageNumText" class="pear-btn-md pear-btn-primary" value="1" readonly="readonly" style="width: 75px">
        <input type="button" id="axisNet" class="pear-btn pear-btn-md pear-btn-primary" value="下一页" style="width: 75px;"/>
    </div>

    <div id="show" class="layui-card" style="display:none;">
        <div class="layui-card-body">
            <table id="axis-table" lay-filter="axis-table"></table>

            <script type="text/html" id="axis-toolbar">
                <button  sec:authorize="hasPermission('/system/axis/add','system:axis:add')"  class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
                    <i class="layui-icon layui-icon-add-1"></i>
                    新增
                </button>
                <button  sec:authorize="hasPermission('/system/axis/remove','system:axis:remove')"   class="pear-btn pear-btn-danger pear-btn-md" lay-event="batchRemove">
                    <i class="layui-icon layui-icon-delete"></i>
                    删除
                </button>
            </script>

            <script type="text/html" id="axis-bar">
                <button  sec:authorize="hasPermission('/system/axis/edit','system:axis:edit')"   class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>
                </button>
                <button  sec:authorize="hasPermission('/system/axis/remove','system:axis:remove')"   class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i class="layui-icon layui-icon-delete"></i>
                </button>
            </script>
        </div>
    </div>
    <!--模态框内容-->
    <div class="modal fade" id="myModal" onclick="showAxisModal();" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-body">
                    <div class="modalEcharts" id="axisPrcModal">
                        主轴图片
                    </div>
                    <div class="modalEcharts" id="modalEchartsDom">
                        速度表盘
                    </div>
                    <div class="modalEcharts">
                        实时产量折线图
                    </div>
                    <div class="modalAxisDiv">
                        <div class="modalAxisDivChirean">
                            主轴型号:&nbsp&nbsp<span id="axisTypeModal" style="color: #2D8CF0"></span>
                        </div>
                        <div class="modalAxisDivChirean">
                            主轴位置:&nbsp&nbsp<span id="axisSpaceModal" style="color: #2D8CF0"></span>
                        </div>
                        <div class="modalAxisDivChirean">
                            操作者:&nbsp&nbsp<span id="currentOperatorModal" style="color: #2D8CF0"></span>
                        </div>
                        <div class="modalAxisDivChirean">
                            计划生产数量:&nbsp&nbsp<span id="schedulingModal" style="color: #2D8CF0"></span>
                        </div>
                        <div class="modalAxisDivChirean">
                            实际生产数量:&nbsp&nbsp<span id="actuallyCompleteModal" style="color: #2D8CF0"></span>
                        </div>
                        <div class="modalAxisDivChirean" id="ModalA">

                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<script>
    //展示表单方法
    function showdiv(){
        if($("#show").css("display")=='none'){//如果show是隐藏的
            $("#switch").html("隐藏表单");
            $("#show").css("display","block");//show的display属性设置为block（显示）
        }else{//如果show是显示的
            $("#show").css("display","none");//show的display属性设置为none（隐藏）
            $("#switch").html("显示表单");
        }
    }
    //定时任务
    function myFunction() {
        setInterval(creatAxisDiv, 5000);
    }

    window.onload=function () {
        creatAxisDiv();
        myFunction();
        myFunction2();
    }
    // 默认生成的主轴div
    function getAxisCount(){
         var axisState = $("#axisState").val();
         console.log("axistate:"+axisState);
        $.ajax({
            type:"get",
            async:false,
            url:"/system/axis/selectAxisCountByState",
            dataType:'json',
            data:{axisState:axisState},
            success: function (result) {  //返回主轴合集
                $("#axisCount").val(result);
            }
        })

    }

    function creatAxisDiv(){
        $.ajax({
            type:"get",
            url:"/system/axis/data",
            dataType:'json',
            data: $("#formId").serialize()+'&'+$("#pageForm").serialize(),
            success: function (result) {  //返回主轴合集
                var html="";
                for(var i=0;i<result.data.length;i++){
                    if(result.data[i].axisState=='正常'){
                        html+="<div class='axisDiv' onclick='clickAxisDiv(this);' style='color: #ffffff'>"+
                            "<img src="+result.data[i].axisPrc+"><br/>" +
                            "型号：<span style='color: #ffffff'>"+result.data[i].axisType+"</span>&nbsp&nbsp"+
                            "状态：<span>"+result.data[i].axisState+"</span></br>"+
                            "位置：<span>"+result.data[i].axisSpace+"</span></br>"+
                            "当前转速：<span>"+result.data[i].axisRev+"</span></div>"+
                            "<span class='axisId' style='display: none'>"+result.data[i].axisId+"</span>"
                    }else if (result.data[i].axisState=='故障'){
                        html+="<div class='axisDiv' onclick='clickAxisDiv(this);' style='color: #ffffff'>"+
                            "<img src="+result.data[i].axisPrc+"><br/>" +
                            "型号：<span>"+result.data[i].axisType+"</span>&nbsp&nbsp"+
                            "状态：<span>"+result.data[i].axisState+"</span></br>"+
                            "位置：<span>"+result.data[i].axisSpace+"</span></br>"+
                            "故障原因：<span style='color: red'>"+result.data[i].spare1+"</span></div>"+
                            "<span class='axisId' style='display: none'>"+result.data[i].axisId+"</span>"
                    }else if (result.data[i].axisState=='调试'){
                        html+="<div class='axisDiv' onclick='clickAxisDiv(this);' style='color: #ffffff'>"+
                            "<img src="+result.data[i].axisPrc+"><br/>" +
                            "型号：<span>"+result.data[i].axisType+"</span>&nbsp&nbsp"+
                            "状态：<span>"+result.data[i].axisState+"</span></br>"+
                            "位置：<span>"+result.data[i].axisSpace+"</span></br>"+
                            "当前转速：<span>"+result.data[i].axisRev+"</span></div>"+
                            "<span class='axisId' style='display: none'>"+result.data[i].axisId+"</span>"
                    }
                }
                $("#axisDivAll").html(html);
            }
        })
    }
    //上一页
    $("#axisPrev").click(function () {
        var pageNum =$("#pageNumText").val();
        if (pageNum==1){
            layer.msg('当前已是第一页');
        }else {
            $("#page").val(parseInt(pageNum-1));
            $("#pageNumText").val(parseInt(pageNum-1));
            $.ajax({
                type:"get",
                url:"/system/axis/data",
                dataType:'json',
                async:false,
                data: $("#formId").serialize()+'&'+$("#pageForm").serialize(),
                success: function (result) {  //返回主轴合集
                    var html="";
                    for(var i=0;i<result.data.length;i++){
                        if(result.data[i].axisState=='正常'){
                            html+="<div class='axisDiv' onclick='clickAxisDiv(this);' style='color: #ffffff'>"+
                                "<img src="+result.data[i].axisPrc+"><br/>" +
                                "型号：<span>"+result.data[i].axisType+"</span>&nbsp&nbsp"+
                                "状态：<span>"+result.data[i].axisState+"</span></br>"+
                                "位置：<span>"+result.data[i].axisSpace+"</span></br>"+
                                "当前转速：<span>"+result.data[i].axisRev+"</span></div>"+
                                "<span class='axisId' style='display: none'>"+result.data[i].axisId+"</span>"
                        }else if (result.data[i].axisState=='故障'){
                            html+="<div class='axisDiv' onclick='clickAxisDiv(this);' style='color: #ffffff'>"+
                                "<img src="+result.data[i].axisPrc+"><br/>" +
                                "型号：<span>"+result.data[i].axisType+"</span>&nbsp&nbsp"+
                                "状态：<span style='color: red'>"+result.data[i].axisState+"</span></br>"+
                                "位置：<span>"+result.data[i].axisSpace+"</span></br>"+
                                "故障原因：<span>"+result.data[i].spare1+"</span></div>"+
                                "<span class='axisId' style='display: none'>"+result.data[i].axisId+"</span>"
                        }else if (result.data[i].axisState=='调试'){
                            html+="<div class='axisDiv' onclick='clickAxisDiv(this);' style='color: #ffffff'>"+
                                "<img src="+result.data[i].axisPrc+"><br/>" +
                                "型号：<span>"+result.data[i].axisType+"</span>&nbsp&nbsp"+
                                "状态：<span>"+result.data[i].axisState+"</span></br>"+
                                "位置：<span>"+result.data[i].axisSpace+"</span></br>"+
                                "当前转速：<span>"+result.data[i].axisRev+"</span></div>"+
                                "<span class='axisId' style='display: none'>"+result.data[i].axisId+"</span>"
                        }
                    }
                    $("#axisDivAll").html(html);
                }
            })
        }
    })

    //下一页
    $("#axisNet").click(function () {
        getAxisCount();
        var pageNum =$("#pageNumText").val();
        var axisCount = $("#axisCount").val();
        var pageMax=Math.ceil(axisCount/12);
        if (pageNum>=pageMax){
            layer.msg('当前已是最后一页');
        }else {
            var html="";
           var pageNum2 = parseInt(pageNum)+parseInt(1);
           $("#pageNumText").val(pageNum2);
           $("#page").val(pageNum2);
           console.log("11111111"+$("#pageNumText").val());
           console.log("22222222"+$("#page").val());
            $.ajax({
                type:"get",
                url:"/system/axis/data",
                dataType:'json',
                data: $("#formId").serialize()+'&'+$("#pageForm").serialize(),
                success: function (result) {  //返回主轴合集
                    for(var i=0;i<result.data.length;i++){
                        if(result.data[i].axisState=='正常'){
                            html+="<div class='axisDiv' onclick='clickAxisDiv(this);' style='color: #ffffff'>"+
                                "<img src="+result.data[i].axisPrc+"><br/>" +
                                "型号：<span>"+result.data[i].axisType+"</span>&nbsp&nbsp"+
                                "状态：<span>"+result.data[i].axisState+"</span></br>"+
                                "位置：<span>"+result.data[i].axisSpace+"</span></br>"+
                                "当前转速：<span>"+result.data[i].axisRev+"</span></div>"+
                                "<span class='axisId' style='display: none'>"+result.data[i].axisId+"</span>"
                        }else if (result.data[i].axisState=='故障'){
                            html+="<div class='axisDiv' onclick='clickAxisDiv(this);' style='color: #ffffff'>"+
                                "<img src="+result.data[i].axisPrc+"><br/>" +
                                "型号：<span>"+result.data[i].axisType+"</span>&nbsp&nbsp"+
                                "状态：<span style='color: red'>"+result.data[i].axisState+"</span></br>"+
                                "位置：<span>"+result.data[i].axisSpace+"</span></br>"+
                                "故障原因：<span>"+result.data[i].spare1+"</span></div>"+
                                "<span class='axisId' style='display: none'>"+result.data[i].axisId+"</span>"
                        }else if (result.data[i].axisState=='调试'){
                            html+="<div class='axisDiv' onclick='clickAxisDiv(this);' style='color: #ffffff'>"+
                                "<img src="+result.data[i].axisPrc+"><br/>" +
                                "型号：<span>"+result.data[i].axisType+"</span>&nbsp&nbsp"+
                                "状态：<span>"+result.data[i].axisState+"</span></br>"+
                                "位置：<span>"+result.data[i].axisSpace+"</span></br>"+
                                "当前转速：<span>"+result.data[i].axisRev+"</span></div>"+
                                "<span class='axisId' style='display: none'>"+result.data[i].axisId+"</span>"
                        }
                    }
                    $("#axisDivAll").html(html);
                }
            })
        }
    })
    //条件查询
    $("#axisQuery").click(function () {
        $("#pageNumText").val(parseInt(1));
        var axisDiv=$("#axisDivAll").html();
        $("#page").val(parseInt(0));
        $("#limit").val(parseInt(12));
        axisDiv="";
        $.ajax({
            url:"/system/axis/data",
            dataType:'json',
            data: $("#formId").serialize()+'&'+$("#pageForm").serialize(),
            success: function (result) {
                var html="";
                for(var i=0;i<result.data.length;i++){
                    console.log("result:"+result.data[i].axisPrc);
                    if(result.data[i].axisState=='正常'){
                        html+="<div class='axisDiv' onclick='clickAxisDiv(this);' style='color: #ffffff'>"+
                            "<img src="+result.data[i].axisPrc+"><br/>" +
                            "型号：<span>"+result.data[i].axisType+"</span>&nbsp&nbsp"+
                            "状态：<span>"+result.data[i].axisState+"</span></br>"+
                            "位置：<span>"+result.data[i].axisSpace+"</span></br>"+
                            "当前转速：<span>"+result.data[i].axisRev+"</span></div>"+
                            "<span class='axisId' style='display: none'>"+result.data[i].axisId+"</span>"
                    }else if (result.data[i].axisState=='故障'){
                        html+="<div class='axisDiv' onclick='clickAxisDiv(this);' style='color: #ffffff'>"+
                            "<img src="+result.data[i].axisPrc+"><br/>" +
                            "型号：<span>"+result.data[i].axisType+"</span>&nbsp&nbsp"+
                            "状态：<span style='color: red'>"+result.data[i].axisState+"</span></br>"+
                            "位置：<span>"+result.data[i].axisSpace+"</span></br>"+
                            "故障原因：<span>"+result.data[i].spare1+"</span></div>"+
                            "<span class='axisId' style='display: none'>"+result.data[i].axisId+"</span>"
                    }else if (result.data[i].axisState=='调试'){
                        html+="<div class='axisDiv' onclick='clickAxisDiv(this);' style='color: #ffffff'>"+
                            "<img src="+result.data[i].axisPrc+"><br/>" +
                            "型号：<span>"+result.data[i].axisType+"</span>&nbsp&nbsp"+
                            "状态：<span>"+result.data[i].axisState+"</span></br>"+
                            "位置：<span>"+result.data[i].axisSpace+"</span></br>"+
                            "当前转速：<span>"+result.data[i].axisRev+"</span></div>"+
                            "<span class='axisId' style='display: none'>"+result.data[i].axisId+"</span>"
                    }
                }
                $("#axisDivAll").html(html);
            }
        })
    })

    //定时刷新模态框
    function myFunction2() {
       setInterval(showAxisModal, 5000);
    }

    var spanAxisId;
    //点击div弹出模态框
    function clickAxisDiv(obj) {
        spanAxisId=$(obj).next().html();
        console.log("spanAxisId---------"+spanAxisId);
        localStorage.setItem("axisId",spanAxisId);
        $('#myModal').modal();
     }

     //当模态框显示出来时执行这个方法
    function showAxisModal(){
        $.ajax({
            url:"/system/axis/selectAxisInfo",
            data:'axisId='+spanAxisId,
            dataType:"json",
            success: function (result) {
                var axisRevModel = 0;
                axisRevModel=result.axisRev;
                $("#axisPrcModal").html("");
                $("#axisPrcModal").append("<img src="+result.axisPrc+">");
                $("#axisTypeModal").html(result.axisType);
                $("#axisSpaceModal").html(result.axisSpace);
                $("#currentOperatorModal").html(result.currentOperator);
                $("#schedulingModal").html(result.scheduling);
                $("#actuallyCompleteModal").html(result.actuallyComplete);
                $("#ModalA").html("<a href='/system/axisShake/main'>查看频谱图</a>");
                var echartDom = document.getElementById('modalEchartsDom');
                var myEchart = echarts.init(echartDom);
                var option;
                option = {
                    series: [{
                        type: 'gauge',
                        radius:'90%',
                        min:0,
                        max:10000,
                        splitNumber:10,   //仪表盘的总刻度数
                        axisLine: {
                            lineStyle: {
                                width: 10,
                                color: [
                                    [0.3, '#67e0e3'],
                                    [0.7, '#37a2da'],
                                    [1, '#fd666d']
                                ]
                            }
                        },
                        pointer: {
                            itemStyle: {
                                color: 'auto'
                            },
                            length:'70%',
                            width:4,
                        },
                        axisTick: {
                            distance: -30,
                            length: '8%',
                            splitNumber:5,
                            lineStyle: {
                                color: '#fff',
                                width: 1
                            }
                        },
                        splitLine: {
                            distance: -20,
                            length: 20,
                            lineStyle: {
                                color: '#fff',
                                width: 3
                            }
                        },
                        axisLabel: {
                            color: 'auto',
                            distance: -10,
                            fontSize: 10,
                        },
                        detail: {
                            padding: [5, 5, -32, 5],
                            fontSize:15,
                            valueAnimation: true,
                            formatter: '{value} r/s',
                            color: 'auto'
                        },
                        data: [{
                            value: axisRevModel,
                        }]
                    }],
                    axisPointer:[{
                        animation:null,
                    }],
                    // animationDelay: function (idx) {
                    //     return idx * 10 + 1000;
                    // }
                };
                myEchart.clear();
                setTimeout(myEchart.setOption(option), 5000);
            }
        })
    }
    layui.use(['table', 'form', 'jquery','dictionary'], function () {
        let table = layui.table;
        let form = layui.form;
        let $ = layui.jquery;

        let prefix = "/system/axis/";

        let cols = [
            [
                {type: 'checkbox'},
                {
                    field: 'axisSpace',
                    title: '位置'
                },
                {
                    field: 'axisType',
                    title: '型号'
                },
                {
                    field: 'currentOperator',
                    title: '操作者'
                },
                {
                    field: 'axisState',
                    title: '状态'
                },
                {
                    field: 'executiveRoutine',
                    title: '执行程序'
                },
                {
                    field: 'startTime',
                    title: '启动时间'
                },
                {
                    field: 'runTime',
                    title: '已运行时间'
                },
                {
                    field: 'manufacturer',
                    title: '售后公司'
                },
                {
                    field: 'manufacturerPhone',
                    title: '售后公司电话'
                },
                {
                    field: 'warrantyPeriod',
                    title: '保修时间'
                },
                {title: '操作', toolbar: '#axis-bar', align: 'center', width: 130}
            ]
        ]

        table.render({
            elem: '#axis-table',
            url: prefix + 'data',
            page: true,
            cols: cols,
            skin: 'line',
            toolbar: '#axis-toolbar',
            defaultToolbar: [{
                layEvent: 'refresh',
                icon: 'layui-icon-refresh',
            }, 'filter', 'print', 'exports']
        });

        table.on('tool(axis-table)', function (obj) {
            if (obj.event === 'remove') {
                window.remove(obj);
            } else if (obj.event === 'edit') {
                window.edit(obj);
            }
        });

        table.on('toolbar(axis-table)', function (obj) {
            if (obj.event === 'add') {
                window.add();
            } else if (obj.event === 'refresh') {
                window.refresh();
            } else if (obj.event === 'batchRemove') {
                window.batchRemove(obj);
            }
        });

        form.on('submit(axis-query)', function (data) {
            table.reload('axis-table', {where: data.field})
            return false;
        });

        window.add = function () {
            layer.open({
                elem: '#installationTime',  //html代码中input的id值 安装时间
                type: 2,
                title: '新增主轴监控',
                shade: 0.1,
                area: ['550px', '500px'],
                content: prefix + 'add',
            });
        }

        window.edit = function (obj) {
            layer.open({
                type: 2,
                title: '修改主轴监控',
                shade: 0.1,
                area: ['550px', '500px'],
                content: prefix + 'edit?axisId=' + obj.data['axisId']
            });
        }

        window.remove = function (obj) {
            layer.confirm('确定要删除该主轴监控', {icon: 3, title: '提示'}, function (index) {
                layer.close(index);
                let loading = layer.load();
                $.ajax({
                    url: prefix + "remove/" + obj.data['axisId'],
                    dataType: 'json',
                    type: 'delete',
                    success: function (result) {
                        layer.close(loading);
                        if (result.success) {
                            layer.msg(result.msg, {icon: 1, time: 1000}, function () {
                                obj.del();
                            });
                        } else {
                            layer.msg(result.msg, {icon: 2, time: 1000});
                        }
                    }
                })
            });
        }

        window.batchRemove = function (obj) {
            let data = table.checkStatus(obj.config.id).data;
            if (data.length === 0) {
                layer.msg("未选中数据", {icon: 3, time: 1000});
                return false;
            }
            let ids = "";
            for (let i = 0; i < data.length; i++) {
                ids += data[i].axisId + ",";
            }
            ids = ids.substr(0, ids.length - 1);
            layer.confirm('确定要删除这些主轴监控', {icon: 3, title: '提示'}, function (index) {
                layer.close(index);
                let loading = layer.load();
                $.ajax({
                    url: prefix + "batchRemove",
                    dataType: 'json',
                    data: {"ids":ids},
                    type: 'delete',
                    success: function (result) {
                        layer.close(loading);
                        if (result.success) {
                            layer.msg(result.msg, {icon: 1, time: 1000}, function () {
                                table.reload('axis-table');
                            });
                        } else {
                            layer.msg(result.msg, {icon: 2, time: 1000});
                        }
                    }
                })
            });
        }

        window.refresh = function (param) {
            table.reload('axis-table', {where: param});
        }
    })
</script>
</body>
</html>